<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="配置类型" prop="type">
        <el-select v-model="queryParams.type" placeholder="请选择配置类型" clearable>
          <el-option v-for="dict in dict.type.auto_operation_config" :key="dict.value" :label="dict.label"
                     :value="dict.value"/>
        </el-select>
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
          <el-option v-for="dict in dict.type.auto_config_status" :key="dict.value" :label="dict.label"
                     :value="dict.value"/>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
        <el-button size="mini" type="primary" @click="handleCategoryList()">查看屏蔽类目</el-button>
        <el-button size="mini" type="success" @click="useShareCode">使用分享码</el-button>
      </el-col>
      <!--      <el-col :span="1.5">-->
      <!--        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button>-->
      <!--      </el-col>-->
      <!--      <el-col :span="1.5">-->
      <!--        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>-->
      <!--      </el-col>-->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <!--  店铺列表  -->
    <el-table v-loading="loading" :data="autoConfigList" border stripe>
      <!--      <el-table-column type="selection" width="55" align="center"/>-->
      <el-table-column label="名称" prop="name" align="center" width="120">
        <template slot-scope="scope">
          <div v-if="scope.row.type=='5' ">整体测评</div>
          <div v-if="scope.row.type=='51' ">单品测评</div>
          <div v-if="scope.row.type=='52'">指定日期测评</div>
          <div v-else>
            <dict-tag :options="dict.type.auto_operation_config" :value="scope.row.type"></dict-tag>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="名称" prop="name" align="center" width="200"/>
      <el-table-column label="规则" prop="commissionTime" align="center" min-width="250">
        <template slot-scope="scope">
          <!-- 上架规则 -->
          <div v-if="scope.row.type=='0'">
            <span>
              每天{{ scope.row.configData.pulishBeginTime }}-{{ scope.row.configData.pulishEndTime }}，
              上架{{ scope.row.configData.pulishNumberByDay }}个商品</span>
            <span>，价格区间{{ scope.row.configData.priceFloor }}-{{ scope.row.configData.priceCeiling }}</span>
          </div>
          <!-- 下架规则 -->
          <div v-if="scope.row.type=='1'">
            <span>统计周期{{ scope.row.configData.cycle }}，</span>
            <span>访客数量小于{{ scope.row.configData.visitorLess }}，</span>
            <span>{{ scope.row.configData.history == '1' ? '且历史从未出单，' : '' }}</span>
            <span>{{ scope.row.configData.autoShelf == '0' ? '' : '下架后自动上架' }}</span>
            <span>{{ scope.row.configData.isOriginal == '1' ? '，按下架商品的原上架计划执行' : '' }}</span>
            <span></span>
          </div>
          <!-- 降价规则 -->
          <div v-if="scope.row.type=='2'">
            <span>统计周期{{ scope.row.configData.statisticalPeriod }}，</span>
            <span>大于{{ scope.row.configData.termOneVisitorNumber }}访客</span>
            <span v-if="scope.row.configData.termOneIsHistoryOrder=='1'">，且历史从未出单，</span>
            <span>大于{{ scope.row.configData.termTwoVisitorNumber }}访客，</span>
            <span v-if="scope.row.configData.termTwoIsHistoryOrder=='1'">
              共出单{{ scope.row.configData.termTwoHistoryOrderNumber }}单以内
            </span>
            <span v-if="scope.row.configData.priceOffType=='0'">
              降价数量{{ scope.row.configData.priceOffNumber }}%以内，
            </span>
            <span v-if="scope.row.configData.priceOffType=='1'">
              降价数量{{ scope.row.configData.priceOffNumber }}个以内，
            </span>
            <span>降价周期{{ scope.row.configData.priceOffPeriod }}天以内不允许二次降价，</span>
            <span>降价幅度{{ scope.row.configData.priceOffRange }}%</span>
            <span v-if="scope.row.configData.priceOffExpectType=='0'">
              降价预期亏损不超过{{ scope.row.configData.priceOffExpect }}%
            </span>
            <span v-if="scope.row.configData.priceOffExpectType=='1'">
              降价预期盈利不低于{{ scope.row.configData.priceOffExpect }}%
            </span>
            <span v-if="scope.row.configData.priceOffExpectType=='2'">
              降价预期亏损不超过{{ scope.row.configData.priceOffExpect }}元人民币
            </span>
            <span v-if="scope.row.configData.priceOffExpectType=='3'">
              降价预期盈利不低于{{ scope.row.configData.priceOffExpect }}元人民币
            </span>
          </div>
          <!-- 涨价规则 -->
          <div v-if="scope.row.type=='3'">
            <span>平均亏损{{ scope.row.configData.termFristAverageLoss }}元以内的不执行涨价，</span>
            <span>
              单品亏损{{ scope.row.configData.termOneLossPrice }}元以上，
              调整折扣后亏损{{ scope.row.configData.termOneAdjustmentLossPrice }}元以内
            </span>
            <span>
              亏损超过{{ scope.row.configData.termTwoOrderNumber }}单及以上，
              上调折扣{{ scope.row.configData.termTwoAdjustmentDiscount }}%
            </span>
            <span>
              亏损超过{{ scope.row.configData.termTwoOrderNumber }}单及以上，
              每亏损{{ scope.row.configData.termThreeOrderNumber }}单及以上，
              上调折扣{{ scope.row.configData.termThreeAdjustmentDiscount }}%
            </span>
            <span v-if="scope.row.configData.priceRiseType=='0'">
              涨价数量{{ scope.row.configData.priceRiseNumber }}%以内，
            </span>
            <span v-if="scope.row.configData.priceRiseType=='1'">
              降价数量{{ scope.row.configData.priceRiseNumber }}个以内，
            </span>
            <span>涨价周期{{ scope.row.configData.priceOffPeriod }}天以内不允许二次张价，</span>
            <span v-if="scope.row.configData.priceRiseExpectType=='0'">
              涨价预期亏损不超过{{ scope.row.configData.priceRiseExpect }}%
            </span>
            <span v-if="scope.row.configData.priceRiseExpectType=='1'">
              涨价预期亏损不超过{{ scope.row.configData.priceRiseExpect }}元人民币
            </span>
            <span v-if="scope.row.configData.priceRiseExpectType=='2'">
              涨价预期盈利不低于{{ scope.row.configData.priceRiseExpect }}%
            </span>
            <span v-if="scope.row.configData.priceRiseExpectType=='3'">
              涨价预期盈利不低于{{ scope.row.configData.priceRiseExpect }}元人民币
            </span>
            <span v-if="scope.row.configData.priceRiseExpectType=='4'">
              涨价预期亏损不超过{{ scope.row.configData.priceRiseExpect }}元人民币，
              且近{{ scope.row.configData.priceRiseExpectDay }}天出单
              {{ scope.row.configData.priceRiseExpectOrderNumber }}单及以上
            </span>
            <span v-if="scope.row.configData.priceRiseExpectType=='5'">
              涨价预期盈利不低于{{ scope.row.configData.priceRiseExpect }}元人民币，
              且近{{ scope.row.configData.priceRiseExpectDay }}天出单
              {{ scope.row.configData.priceRiseExpectOrderNumber }}单及以上
            </span>
          </div>
          <!-- 信息模块 -->
          <div v-if="scope.row.type=='4'">
            <!--            <span>商品来源于{{ scope.row.configData.startTime }}，</span>-->
            <span>创建不少于{{ scope.row.configData.productCount }}个商品，</span>
            <!--            <span>出单商品{{ scope.row.configData.startTime }}，</span>-->
            <!--            <span>高访客商品{{ scope.row.configData.startTime }}，</span>-->
            <span>更换信息模块不少于{{ scope.row.configData.modelValidity }}天，</span>
            <span>{{ scope.row.configData.modelReplace }}天内主商品和信息模块中商品均未出单</span>
          </div>
          <!-- 测评 -->
          <!--            整体测评-->
          <div v-if="scope.row.type=='5' ">
              <span>
                {{ scope.row.configData.nullOrderDay }}天不出单，
                优先测评近{{ scope.row.configData.beforeDay }}天出的自然订单测评一单，
              </span>
            <span>
                测评金额不低于{{ scope.row.configData.amountMin }}元，不超过{{ scope.row.configData.amountMax }}元
              </span>
          </div>
          <!-- 单体测评 -->
          <div v-if="scope.row.type=='51' ">
              <span>
                单品出单达到{{ scope.row.configData.orderQuantity }}单后，
                第二天测评{{ scope.row.configData.afterNumber }}单本商品，
              </span>
            <span v-if="scope.row.configData.isEvaluation =='1' ">测评的上一个订单不能是测评单，</span>
          </div>
          <!-- 指定日期测评 -->
          <div v-if="scope.row.type=='52'">
              <span>
                {{ scope.row.configData.planStartTime }} 测评{{ scope.row.configData.planEvaluationNum }}单，
              </span>
            <span>
                测评近{{ scope.row.configData.beforeDay }}天出的自然订单，
              </span>
            <span>
                测评金额不低于{{ scope.row.configData.amountMin }}元，不超过{{ scope.row.configData.amountMax }}元
              </span>
          </div>
          <!-- 满减 -->
          <div v-if="scope.row.type=='6'">
            <span>
              活动时间：{{ parseTime(scope.row.configData.startTime) + ' - ' }}
              {{ parseTime(scope.row.configData.endTime) }}，</span>
            <span>活动类型：{{ scope.row.configData.type == '1' ? '满立减' : '满件减' }}，</span>
            <span>{{ scope.row.configData.accumulation == '1' ? '累加' : '不累加' }}</span>
          </div>
          <div v-if="scope.row.type=='7'">
            全平台折扣{{ scope.row.configData.platformDiscount }}
          </div>
        </template>
      </el-table-column>
      <el-table-column label="预计结束时间" prop="pulishEndDay" align="center" min-width="180">
        <template slot-scope="scope">
          {{ scope.row.configData.pulishEndDay }}
          <!--          <div>{{ scope.row.countdown ? scope.row.countdown : '暂无' }}</div>-->
        </template>
      </el-table-column>
      <el-table-column label="状态" prop="status" align="center" width="100">
        <template slot-scope="scope">
          <div v-if="scope.row.type=='5' || scope.row.type=='51' || scope.row.type=='52'">
            <dict-tag :options="dict.type.auto_config_evaluation_status" :value="scope.row.status"></dict-tag>
          </div>
          <div v-else>
            <dict-tag :options="dict.type.auto_config_status" :value="scope.row.status"></dict-tag>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="异常原因" prop="remark" align="center" min-width="150">
        <template slot-scope="scope">
          <div>{{ scope.row.configData.remark ? scope.row.configData.remark : '暂无' }}</div>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
        <template slot-scope="scope">
          <el-button v-if="scope.row.type == '0' || scope.row.type == '1'|| scope.row.type == '5' " size="mini"
                     type="text" @click="handleView(scope.row)">查看
          </el-button>
          <el-button v-if="scope.row.type != '52'" size="mini" type="text"
                     @click="handleUpdate(scope.row)">编辑
          </el-button>
          <!--          <el-button size="mini" type="text" @click="handleDelete(scope.row)">删除</el-button>-->
          <el-button v-if="scope.row.type != '6' && scope.row.type != '7'" size="mini" type="text"
                     @click="handleDisable(scope.row)">
            {{ scope.row.status == '1' ? '禁用' : '启用' }}
          </el-button>
          <el-button v-if="scope.row.type == '6'" size="mini" type="text" @click="handleStop(scope.row)">停用
          </el-button>
          <el-button size="mini" type="text" @click="createShareCode(scope.row)">生成分享码</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                @pagination="getList"/>

    <!-- 添加或修改商品资质信息对话框 -->
    <el-dialog title="新增自运营配置" :visible.sync="open" width="800px" append-to-body>
      <el-radio-group v-model="autoConfigValue">
        <el-radio v-for="item in dict.type.auto_operation_config" :key="item.value" :label="item.value">
          {{ item.label }}
        </el-radio>
      </el-radio-group>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm()">确 定</el-button>
        <el-button @click="open = false">取 消</el-button>
      </div>
    </el-dialog>

    <!--  上架  -->
    <grounding v-if="isOpen=='0'" @close="closeModal" :storeId="storeId" :configId="configId"
               :storeUserName="storeUserName" :userId="userId" :isUseShareCode="isUseShareCode"/>
    <!--  下架  -->
    <offShelf v-if="isOpen == '1'" @close="closeModal" :storeId="storeId" :configId="configId"
              :storeUserName="storeUserName" :userId="userId" :isUseShareCode="isUseShareCode"/>
    <!--  降价  -->
    <cutPrice v-if="isOpen=='2'" @close="closeModal" :storeId="storeId" :configId="configId"
              :storeUserName="storeUserName" :userId="userId" :isUseShareCode="isUseShareCode"/>
    <!--  涨价  -->
    <risePrice v-if="isOpen=='3'" @close="closeModal" :storeId="storeId" :configId="configId"
               :storeUserName="storeUserName" :userId="userId" :isUseShareCode="isUseShareCode"/>
    <!--  信息模块  -->
    <infoModule v-if="isOpen=='4'" @close="closeModal" :storeId="storeId" :configId="configId"
                :storeUserName="storeUserName" :userId="userId" :isUseShareCode="isUseShareCode"/>
    <!--  测评  -->
    <evaluation v-if="isOpen=='5' || isOpen=='51' || isOpen=='52'" @close="closeModal" :storeId="storeId"
                :configId="configId" :storeUserName="storeUserName" :userId="userId" :isUseShareCode="isUseShareCode"
                :evaluationType="isOpen"/>
    <!--  满减  -->
    <FullReduction v-if="isOpen=='6'" @close="closeModal" :storeId="storeId" :configId="configId"
                   :storeUserName="storeUserName" :userId="userId" :isUseShareCode="isUseShareCode"/>
    <!--  金币折扣  -->
    <GoldActivity v-if="isOpen=='7'" @close="closeModal" :storeId="storeId" :configId="configId"
                  :storeUserName="storeUserName" :userId="userId" :isUseShareCode="isUseShareCode"/>

    <!--  查看上架数据  -->
    <groundView v-if="isOpenGroundModal" :configId="configId" @close="isOpenGroundModal = false"/>
    <!-- 查看上架失败类目列表   -->
    <CategoryList v-if="isOpenCategoryList" :storeId="storeId" @close="isOpenCategoryList = false"/>
    <!--    查看下架数据-->
    <OffShelfView v-if="isOpenOffShlfModal" :configId="configId" :storeId="storeId"
                  @close="isOpenOffShlfModal = false"/>
    <!--    查看自动测评商品列表-->
    <EvalutaionView v-if="isOpenEvaluation" :configId="configId" @close="isOpenEvaluation = false"/>
  </div>
</template>

<script>
import {queryAutoConfigList, createShareCode, useShareCode} from "@/api/autoOperation/autoConfig";
import {editPulishProjectStatus} from "@/api/autoOperation/ground";
import {updateStatusById} from "@/api/autoOperation/infoModule";
import {updateEvaluationStatus} from "@/api/autoOperation/evaluation";
import {editProjectStatus} from "@/api/autoOperation/cutPrice"
import {editRisePriceStatus} from "@/api/autoOperation/risePrice"
import {getSellerStoreEmpower} from "@/api/seller/sellerStoreEmpower";
import {stopActivity} from "@/api/autoOperation/fullReduction";
import {setStatus} from "@/api/autoOperation/offShelf";
import groundView from "@/views/automation/components/ground/groundView.vue";
import OffShelfView from "@/views/automation/components/offShelf/offShelfView.vue";

import FullReduction from "@/views/automation/components/fullReduction/fullReduction.vue";
import grounding from "@/views/automation/components/ground/grounding.vue";
import offShelf from "@/views/automation/components/offShelf/offShelf.vue";
import cutPrice from "@/views/automation/components/cutPrice/cutPrice.vue";
import evaluation from "@/views/automation/components/evalutaion/evaluation.vue";
import risePrice from "@/views/automation/components/risePrice/risePrice.vue";
import infoModule from "@/views/automation/components/infoModule/infoModule.vue";
import GoldActivity from "@/views/automation/components/goldActivity.vue";
import CategoryList from "@/views/automation/components/ground/categoryList.vue";
import EvalutaionView from "@/views/automation/components/evalutaion/evalutaionView.vue";

export default {
  name: "index",
  dicts: ['auto_operation_config', 'auto_config_status', 'auto_config_evaluation_status'],
  components: {
    grounding,
    offShelf,
    cutPrice,
    evaluation,
    risePrice,
    infoModule, EvalutaionView,
    groundView, FullReduction, GoldActivity, CategoryList, OffShelfView
  },
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: false,
      open: false,//是否打开新增配置模态框
      autoConfigValue: "0",//配置类型
      isOpen: "",//
      isOpenConfigIndex: false,//是否打开配置首页组件
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      autoConfigList: [],//自运营配置列表
      total: 0,
      queryParams: {
        // pageNum: 1,
        // pageSize: 10,
        storeId: "",
        type: ""
      },
      storeId: "",
      configId: "",//配置id
      isOpenGroundModal: false,//是否打开上架数据弹窗
      isOpenOffShlfModal: false,//是否打开下架数据弹窗
      isOpenCategoryList: false,
      isOpenEvaluation: false,//是否打开自动测评商品列表弹窗
      storeUserName: "",
      userId: "",
      isUseShareCode: "0",//是否使用分享码,1:使用分享码
      evaluationType: "",//测评类型
    }
  },
  created() {
    this.storeId = this.$route.query.storeId
    this.queryParams.storeId = this.storeId
    this.getList()
    this.getStoreInfo()
  },
  methods: {
    // 生成分享码
    createShareCode(row) {
      this.$confirm('是否确定生成分享码？', '提示').then(() => {
        let data = {
          planId: row.id,
          shareName: row.name,
          planType: row.type
        }
        createShareCode(data).then(res => {
          // this.$message.success(res.msg)
          let data = res.data
          this.$confirm('分享码为：' + data, '提示', {showCancelButton: false}).then(() => {
            var input = document.createElement('input')
            input.value = data
            document.body.appendChild(input) // 添加input标签
            input.select()  // 选中input标签
            document.execCommand('copy') // 执行复制
            this.$message.success('复制分享码成功！') // 成功提示信息
            document.body.removeChild(input) // 移除input标签
          })
        })
      })
    },
    // 使用分享码
    useShareCode() {
      this.$prompt('请输入分享码', '提示', {
        inputPattern: /^.+$/,
        inputErrorMessage: '分享码不能为空',
      }).then((value) => {
        if (value) {
          useShareCode({id: value.value}).then(res => {
            let data = res.data
            this.configId = data.config.id
            this.isOpen = data.planType
            console.log('isOpen', this.isOpen)
            this.isUseShareCode = data.isUse.toString();
            this.$message.success(res.msg)
          })
        }
      })
    },
    // 获取店铺信息
    getStoreInfo() {
      getSellerStoreEmpower(this.storeId).then(response => {
        this.storeUserName = response.data.storeUserName;
        // this.userId = this.$store.getters.userId
        this.userId = response.data.userId
      });
    },
    // 获取自运营配置列表
    getList() {
      this.loading = true
      queryAutoConfigList(this.queryParams).then(res => {
        this.loading = false
        let list = res.data

        for (let i = 0; i < list.length; i++) {
          for (let key in list[i].configData) { //将所有字符转成字符串
            if (list[i].configData[key] != null) {
              list[i].configData[key] = '' + list[i].configData[key]
            }
          }
          if (list[i].configData.createTime) {
            let limit = list[i].configData.pulishUpperLimit //每天上架上限
            let num = list[i].configData.pulishNumberByDay //每天上架数量
            let time = Math.ceil(limit / num);
            let createTime = new Date(list[i].configData.createTime)

            let endTime = new Date(createTime)
            endTime.setDate(createTime.getDate() + time)
            list[i]['countdown'] = this.parseTime(endTime, '{y}-{m}-{d}')
          } else {
            list[i]['countdown'] = "/"
          }
        }
        this.autoConfigList = list
        console.log('this.autoConfigList', this.autoConfigList)
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      // const ids = row.id || this.ids;
      // this.$modal.confirm('是否确认删除商品资质信息编号为"' + ids + '"的数据项？').then(() => {
      //   this.loading = true;
      //   return delCollectProductQualifications(ids);
      // }).then(() => {
      //   this.loading = false;
      //   this.getList();
      //   this.$modal.msgSuccess("删除成功");
      // }).catch(() => {
      // }).finally(() => {
      //   this.loading = false;
      // });
    },
    // 停用
    handleStop(row) {
      this.$confirm('是否停用该计划？').then(() => {
        stopActivity({id: row.id}).then((res) => {
          this.$message.success(res.msg)
          this.getList()
        })
      })
    },
    // 启用/禁用
    handleDisable(row) {
      this.$confirm('是否要修改该配置状态？').then(() => {
        let data = {
          id: row.id,
          status: row.status == '1' ? '0' : '1'
        }
        let type = row.type;
        if (type == '5' || type == '51' || type == '52') {
          data.type = type
        }
        let configData = {
          "0": editPulishProjectStatus,
          "1": setStatus,
          "2": editProjectStatus,
          "3": editRisePriceStatus,
          "4": updateStatusById,
          "5": updateEvaluationStatus,
          "51": updateEvaluationStatus,
          "52": updateEvaluationStatus,
        }
        configData[type](data).then(res => {
          this.$message.success(res.msg)
          this.getList()
        })
      })
    },
    // 查看类目列表
    handleCategoryList() {
      this.isOpenCategoryList = true
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.open = true;
      this.title = "新增自运营配置";
      this.autoConfigValue = '0'
    },
    // 查看上架数据
    handleView(row) {
      this.configId = row.id
      let type = row.type
      if (type == '0') {
        this.isOpenGroundModal = true
      } else if (type == '1') {
        this.isOpenOffShlfModal = true
      } else if (type == '5') {
        this.isOpenEvaluation = true
      }
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.configId = row.id
      this.isOpen = row.type
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      if (this.queryParams.type == '5') {
        this.queryParams.type = '5,51,52'
      }
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    // 表单重置
    reset() {
      this.form = {
        // categoryId: undefined,
        // categoryQualificationId: undefined,
        // value: undefined,
        // memo: undefined,
        categoryId: undefined,
        categoryQualificationId: undefined,
        memo: undefined,
        // value: undefined,
        detailsList: []
      };
      this.resetForm("form");
    },
    confirm() {
      if (this.autoConfigValue == '7' && this.autoConfigList.findIndex(item => item.type == '7') != -1) {
        this.$message.error('金币折扣最多添加一项！')
        return
      }
      this.open = false
      this.isOpen = this.autoConfigValue
    },
    closeModal() {
      // this.$emit('close', false)
      this.isOpen = ""
      this.configId = ""
      this.isUseShareCode = '0'
      this.getList()
    }
  }
}
</script>
